#include "cpu/exec/template-start.h"

#if DATA_BYTE == 2 || DATA_BYTE == 4
make_helper(concat(movsxb_, SUFFIX)) {
    int len = decode_rm2r_b(eip + 1);
    REG(op_dest->reg) = (int8_t)op_src->val;

    print_asm("movsxb" str(SUFFIX) " %s,%%%s", op_src->str, REG_NAME(op_dest->reg));
    return len + 1;
}

#if DATA_BYTE == 4
make_helper(concat(movsxw_, SUFFIX)) {
    int len = decode_rm2r_w(eip + 1);
    REG(op_dest->reg) = (int16_t)op_src->val;

    print_asm("movsxw" str(SUFFIX) " %s,%%%s", op_src->str, REG_NAME(op_dest->reg));
    return len + 1;
}
#endif
#endif

#include "cpu/exec/template-end.h"